package com.gpipe.tools;

import com.gpipe.properties.InputProperties;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by admin on 2017/8/28.
 */
public class AmountSum {

    private String lacCiO;
    private String lacCiD;
    private String b_area_id_o;
    private String m_area_id_o;
    private String s_area_id_o;
    private String b_area_name_o;
    private String m_area_name_o;
    private String s_area_name_o;

    private String b_area_id_d;
    private String m_area_id_d;
    private String s_area_id_d;
    private String b_area_name_d;
    private String m_area_name_d;
    private String s_area_name_d;
    private AtomicInteger amountSum = new AtomicInteger(0);

    public AmountSum(String lacCiO,String lacCiD) {
        setLacCiO(lacCiO);
        setLacCiD(lacCiD);
        amountSum = new AtomicInteger(1);
    }

    public AmountSum(String lacCiO,String lacCiD,String amountSum) {
        setLacCiO(lacCiO);
        setLacCiD(lacCiD);
        this.amountSum = new AtomicInteger(Integer.parseInt(amountSum));
    }

    public void setLacCiO(String lacCiO) {
        this.lacCiO = lacCiO;

        BaseAreaModel bam = InputProperties.baseArea.get(lacCiO);
        if (bam != null) {
            this.b_area_id_o = bam.getB_area_id();
            this.m_area_id_o = bam.getM_area_id();
            this.s_area_id_o = bam.getS_area_id();
            this.b_area_name_o = bam.getB_area_name();
            this.m_area_name_o = bam.getM_area_name();
            this.s_area_name_o = bam.getS_area_name();
        }
    }

    public void setLacCiD(String lacCiD) {
        this.lacCiD = lacCiD;

        BaseAreaModel bam = InputProperties.baseArea.get(lacCiD);
        if (bam != null) {
            this.b_area_id_d = bam.getB_area_id();
            this.m_area_id_d = bam.getM_area_id();
            this.s_area_id_d = bam.getS_area_id();
            this.b_area_name_d = bam.getB_area_name();
            this.m_area_name_d = bam.getM_area_name();
            this.s_area_name_d = bam.getS_area_name();
        }
    }

    public AtomicInteger getAmountSum() {
        return amountSum;
    }

    public void setAmountSum(AtomicInteger amountSum) {
        this.amountSum = amountSum;
    }

    public String getLacCiO() {
        return lacCiO;
    }
    public String getLacCiD() {
        return lacCiD;
    }


}
